<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<#include "../common/res.html">
		
		<script type="text/javascript">
			function dosubmit(){
				var account = $('#id_account').val();
				account = account.replace(/(\s*$)/g, '');
				if(account == ''){
					alert('请填写微信公众号ID');
					return false;
				}else{
					return true;
				}
			}
			function getUrl(){
				var account = $('#id_account').val();
				account = account.replace(/(\s*$)/g, '');
				if(account == ''){
					alert('请填写微信公众号ID');
					return false;
				}else{
					$('#id_url').val('url');
					$('#id_tocken').val('tocken');
				}
			}
		</script>
	</head>
	
	<body class="bg">
		<#include "../common/top.html">
		
		<div class="content">
			<div class="block-nav">
				<#include "../common/nav.html">
			</div>
			
			<div class="block-content" >
			
				<div class="block-content-nav">
					<span class="title">URL 和 Token</span>
				</div>
				
				<div class="block-content-description">
					<span>填写 <span style="color:#555;">公众号ID</span>，点击 <span style="color:#555;">保存</span> 按钮，
					系统将自动生成 URL 和 Token 。将它们填写到公众平台 
					<span style="color:#555;">开发者中心</span> 中，公众账号即可升级成为开发者账号
					</span>
				</div>
				
				<div class="block-content-content">
					<form class="fm-form" action="${s.base}/wxcms/getUrl.html" method="post" onsubmit="return dosubmit();">
						<input type="hidden" name="id" value="${account.id!}"/>
						<ul>
							<li>
								<label>公众号ID </label>
								<input id="id_account" name="account" type="text" value="${account.account!}"/>
								<span style="color: red;">*(字母或者数字)</span>
							</li>
							<li>
								<label>URL </label>
								<input id="id_url" readonly="readonly" name="url" style="width:500px;" type="text" value="${account.url!}"/>
							</li>
							<li>
								<label>Token </label>
								<input id="id_tocken" readonly="readonly" name="token" style="width:500px;" type="text" value="${account.token!}"/>
							</li>
							<li>
								<label>AppId </label>
								<input name="appid" style="width:500px;" type="text" value="${account.appid!}"/>
							</li>
							<li>
								<label>AppSecret </label>
								<input name="appsecret" style="width:500px;" type="text" value="${account.appsecret!}"/>
							</li>
							<li>
								<label>消息条数 </label>
								<select name="msgcount">
									<option value="1" <#if account.msgcount?? && account.msgcount == 1>selected = "selected"</#if> >1条</option>
									<option value="2" <#if account.msgcount?? && account.msgcount == 2>selected = "selected"</#if> >2条</option>
									<option value="3" <#if account.msgcount?? && account.msgcount == 3>selected = "selected"</#if> >3条</option>
									<option value="4" <#if account.msgcount?? && account.msgcount == 4>selected = "selected"</#if> >4条</option>
									<option value="5" <#if account.msgcount?? && account.msgcount == 5>selected = "selected"</#if> >5条</option>
									<option value="6" <#if account.msgcount?? && account.msgcount == 6>selected = "selected"</#if> >6条</option>
									<option value="7" <#if account.msgcount?? && account.msgcount == 7>selected = "selected"</#if> >7条</option>
									<option value="8" <#if account.msgcount?? && account.msgcount == 8>selected = "selected"</#if> >8条</option>
								</select>
								<span class="gray-span"> 回复图文消息条数</span>
							</li>
						</ul>
						
						<div style="margin-left:75px;margin-top: 20px;">
							<input class="btn" type="submit" value="保 存"/>
							<#if successflag??> 
								<span style="margin-left:10px;color:#44b549;">已成功获取URL 和 Token，请填写到微信平台中</span>
							</#if>
						</div>
					</form>
				</div>
				
			</div>
			
			<div class="clearfloat"></div>
		</div>
		
		<#include "../common/footer.html">
	</body>
	
</html>
